home *** CD-ROM | disk | FTP | other *** search
/ QuickTime 2.0 Beta / Quicktime 2.0 Beta.iso / Programming Stuff / Interfaces / Universal Interfaces / SCSI.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-01-30  |  4.9 KB  |  146 lines  |  [TEXT/MPS ]

  1. /*
  2.     File:        SCSI.h
  3.  
  4.     Copyright:    © 1984-1993 by Apple Computer, Inc., all rights reserved.
  5.  
  6.     WARNING
  7.     This file was auto generated by the interfacer tool. Modifications
  8.     must be made to the master file.
  9.  
  10. */
  11.  
  12. #ifndef __SCSI__
  13. #define __SCSI__
  14.  
  15. #ifndef __TYPES__
  16. #include <Types.h>
  17. /*    #include <ConditionalMacros.h>                                */
  18. /*    #include <MixedMode.h>                                        */
  19. /*        #include <Traps.h>                                        */
  20. #endif
  21.  
  22. enum  {
  23.     scInc                        = 1,
  24.     scNoInc                        = 2,
  25.     scAdd                        = 3,
  26.     scMove                        = 4,
  27.     scLoop                        = 5,
  28.     scNop                        = 6,
  29.     scStop                        = 7,
  30.     scComp                        = 8,
  31.     scCommErr                    = 2,                            /*communications error, operation timeout*/
  32.     scArbNBErr                    = 3,                            /*arbitration timeout waiting for not BSY*/
  33.     scBadParmsErr                = 4,                            /*bad parameter or TIB opcode*/
  34.     scPhaseErr                    = 5,                            /*SCSI bus not in correct phase for attempted operation*/
  35.     scCompareErr                = 6,                            /*data compare error*/
  36.     scMgrBusyErr                = 7,                            /*SCSI Manager busy */
  37.     scSequenceErr                = 8,                            /*attempted operation is out of sequence*/
  38.     scBusTOErr                    = 9,                            /*CPU bus timeout*/
  39.     scComplPhaseErr                = 10,                            /*SCSI bus wasn't in Status phase*/
  40.     sbSIGWord                    = 0x4552,
  41.     pMapSIG                        = 0x504D
  42. };
  43.  
  44. #if defined(powerc) || defined (__powerc)
  45. #pragma options align=mac68k
  46. #endif
  47. struct Block0 {
  48.     unsigned short                sbSig;                            /*unique value for SCSI block 0*/
  49.     unsigned short                sbBlkSize;                        /*block size of device*/
  50.     unsigned long                sbBlkCount;                        /*number of blocks on device*/
  51.     unsigned short                sbDevType;                        /*device type*/
  52.     unsigned short                sbDevId;                        /*device id*/
  53.     unsigned long                sbData;                            /*not used*/
  54.     unsigned short                sbDrvrCount;                    /*driver descriptor count*/
  55.     unsigned long                ddBlock;                        /*1st driver's starting block*/
  56.     unsigned short                ddSize;                            /*size of 1st driver (512-byte blks)*/
  57.     unsigned short                ddType;                            /*system type (1 for Mac+)*/
  58.     unsigned short                ddPad[243];                        /*ARRAY[0..242] OF INTEGER; not used*/
  59. };
  60. #if defined(powerc) || defined(__powerc)
  61. #pragma options align=reset
  62. #endif
  63.  
  64. typedef struct Block0 Block0;
  65.  
  66. #if defined(powerc) || defined (__powerc)
  67. #pragma options align=mac68k
  68. #endif
  69. struct Partition {
  70.     unsigned short                pmSig;                            /*unique value for map entry blk*/
  71.     unsigned short                pmSigPad;                        /*currently unused*/
  72.     unsigned long                pmMapBlkCnt;                    /*# of blks in partition map*/
  73.     unsigned long                pmPyPartStart;                    /*physical start blk of partition*/
  74.     unsigned long                pmPartBlkCnt;                    /*# of blks in this partition*/
  75.     unsigned char                pmPartName[32];                    /*ASCII partition name*/
  76.     unsigned char                pmParType[32];                    /*ASCII partition type*/
  77.     unsigned long                pmLgDataStart;                    /*log. # of partition's 1st data blk*/
  78.     unsigned long                pmDataCnt;                        /*# of blks in partition's data area*/
  79.     unsigned long                pmPartStatus;                    /*bit field for partition status*/
  80.     unsigned long                pmLgBootStart;                    /*log. blk of partition's boot code*/
  81.     unsigned long                pmBootSize;                        /*number of bytes in boot code*/
  82.     unsigned long                pmBootAddr;                        /*memory load address of boot code*/
  83.     unsigned long                pmBootAddr2;                    /*currently unused*/
  84.     unsigned long                pmBootEntry;                    /*entry point of boot code*/
  85.     unsigned long                pmBootEntry2;                    /*currently unused*/
  86.     unsigned long                pmBootCksum;                    /*checksum of boot code*/
  87.     unsigned char                pmProcessor[16];                /*ASCII for the processor type*/
  88.     unsigned short                pmPad[188];                        /*512 bytes long currently unused*/
  89. };
  90. #if defined(powerc) || defined(__powerc)
  91. #pragma options align=reset
  92. #endif
  93.  
  94. typedef struct Partition Partition;
  95.  
  96. #if defined(powerc) || defined (__powerc)
  97. #pragma options align=mac68k
  98. #endif
  99. struct SCSIInstr {
  100.     unsigned short                scOpcode;
  101.     unsigned long                scParam1;
  102.     unsigned long                scParam2;
  103. };
  104. #if defined(powerc) || defined(__powerc)
  105. #pragma options align=reset
  106. #endif
  107.  
  108. typedef struct SCSIInstr SCSIInstr;
  109.  
  110. #ifdef __cplusplus
  111. extern "C" {
  112. #endif
  113.  
  114. extern pascal OSErr SCSIReset(void)
  115.  TWOWORDINLINE(0x4267, 0xA815);
  116. extern pascal OSErr SCSIGet(void)
  117.  THREEWORDINLINE(0x3F3C, 0x0001, 0xA815);
  118. extern pascal OSErr SCSISelect(short targetID)
  119.  THREEWORDINLINE(0x3F3C, 0x0002, 0xA815);
  120. extern pascal OSErr SCSICmd(Ptr buffer, short count)
  121.  THREEWORDINLINE(0x3F3C, 0x0003, 0xA815);
  122. extern pascal OSErr SCSIRead(Ptr tibPtr)
  123.  THREEWORDINLINE(0x3F3C, 0x0005, 0xA815);
  124. extern pascal OSErr SCSIRBlind(Ptr tibPtr)
  125.  THREEWORDINLINE(0x3F3C, 0x0008, 0xA815);
  126. extern pascal OSErr SCSIWrite(Ptr tibPtr)
  127.  THREEWORDINLINE(0x3F3C, 0x0006, 0xA815);
  128. extern pascal OSErr SCSIWBlind(Ptr tibPtr)
  129.  THREEWORDINLINE(0x3F3C, 0x0009, 0xA815);
  130. extern pascal OSErr SCSIComplete(short *stat, short *message, unsigned long wait)
  131.  THREEWORDINLINE(0x3F3C, 0x0004, 0xA815);
  132. extern pascal short SCSIStat(void)
  133.  THREEWORDINLINE(0x3F3C, 0x000A, 0xA815);
  134. extern pascal OSErr SCSISelAtn(short targetID)
  135.  THREEWORDINLINE(0x3F3C, 0x000B, 0xA815);
  136. extern pascal OSErr SCSIMsgIn(short *message)
  137.  THREEWORDINLINE(0x3F3C, 0x000C, 0xA815);
  138. extern pascal OSErr SCSIMsgOut(short message)
  139.  THREEWORDINLINE(0x3F3C, 0x000D, 0xA815);
  140. #ifdef __cplusplus
  141. }
  142. #endif
  143.  
  144. #endif
  145.  
  146.